const c_aside = {
    name: "c_aside",
    template: `
        <ul class="c_aside" v-if="list && list.length > 0">
            <li v-for="(item,index) in list" :key="index" @click="hideNewDetail(item.href)">
                <a :href="item.href" @click="stop">{{ item.title }}</a>
            </li>
        </ul>
    `,
    props: ["list"],
    methods: {
        stop(ev) {
            ev.preventDefault();
        },
        hideNewDetail(href) {
            bus.$emit("hideNewDetail");
            this.scrollTo(href);
        },
        scrollTo(el) {
            const offset = document.querySelector(el).offsetTop;
            const bannerHeight = document.querySelector(".banner").clientHeight;
            const top = offset + bannerHeight - 100;
            window.scrollTo({
                top: el === "#top" ? 0 : top,
                behavior: "smooth"
            })
        }
    }
}
Vue.component("c_aside", c_aside);